﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using ProtoImaginer.ProtoProject;

namespace ProtoImaginer.ProtoProject
{
    public partial class EditProject : PhoneApplicationPage
    {
        public EditProject()
        {
            InitializeComponent();
        }

        private void Name_TextChanged(object sender, TextChangedEventArgs e)
        {

        }

        protected void Complete_Button_Click(object sender, RoutedEventArgs e)
        {
            Guid guid;
            // Create and display the value of two GUIDs.
            guid = Guid.NewGuid();
            Project temp = new Project(
                guid,
                Name_Text.Text,
                //Convert.ToInt32(Author_Text.Text),
                1,//temp author id
                Description_Text.Text,
                Keywords_Text.Text
            );
            MainPage.MyProjects.Add(temp);
            temp = null;
            NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));  
        }

        private void Description_TextChanged(object sender, TextChangedEventArgs e)
        {

        }

        private void Keywords_TextChanged(object sender, TextChangedEventArgs e)
        {

        }

        private void AddPages_Button_Click(object sender, RoutedEventArgs e)
        {
            Guid guid;
            // Create and display the value of two GUIDs.
            guid = Guid.NewGuid();
            Project temp = new Project(
                guid,
                Name_Text.Text,
                //Convert.ToInt32(Author_Text.Text),
                1,//temp author id
                Description_Text.Text,
                Keywords_Text.Text
            );
            MainPage.MyProjects.Add(temp);
            //NavigationService.Navigate(new Uri("/ProtoProject/AddPage.xaml", UriKind.Relative));
        }
    }
}